package com.example.data.approval;

import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class Approval
{
    private Long empID;
    private Date time;
    private Long appID;
    private Integer approvalType;
    private Boolean authorize;
    private String comment;
    public static final int DEPARTMENT_MANAGER = 0;
    public static final int VICE_GENERAL_MANAGER = 1;
    public static final int GENERAL_MANAGER = 2;
    private static Set<Integer> availableType = new HashSet<Integer>()
    {
        {
            addAll(Arrays.asList(new Integer[]{DEPARTMENT_MANAGER, VICE_GENERAL_MANAGER, GENERAL_MANAGER}));
        }
    };
//    protected Approval()//由于不可以是保护的要用注释掉
//    {
//
//    }
    public Long getEmpID(){
        return empID;
    }
    public Long getAppID() {
        return appID;
    }

    public Boolean getApproval() {
        return authorize;
    }

    public String getComment() {
        return comment;
    }

    public Date getTime() {
        return time;
    }

    public Integer getType() {
        return approvalType;
    }

    public void setAppID(Long appID)
    {
        this.appID = appID;
    }

    public void setEmpID(Long empID)
    {
        this.empID = empID;
    }

    public void setApproval(Boolean approval)
    {
        this.authorize = approval;
    }

    public void setComment(String comment)
    {
        this.comment = comment;
    }

    public void setTime(Date time)
    {
        this.time = time;
    }

    public void setType(Integer type)
    {
        if (availableType.contains(type))
        {
            this.approvalType = type;
        }
    }
}
